package com.asset.dispoal.commom.menus;


/**
 * @author qr
 * @date 2022/5/11$
 */
public enum AgreementCaseSateMenu {


    GATHER("gather", "集证", "0", "1", 1),
    WAIT_DELIVERY("waitDeliver", "待派送", "0", "1", 2),
    DOWNLOAD_ORGER("downloadOrder", "待下单", "0", "0", 5),
    WAIT_RECV_ORDER("waitRecvOrder", "待接单", "0", "0", 6),
    MAKE("make", "待制作", "0", "0", 7),
    MAKING("making", "制作中", "0", "0", 8),
    WAIT_UP_CASE("waitUpCase", "待立案", "0", "0", 9),
    PRE_LITIGATION_MEDIATION("preLitigationMediation", "诉前调解", "0", "0", 10),
    REGISTER_CASE("registerCase", "立案", "0", "0", 10),
    JUDGMENT("judgment", "判决", "0", "0", 11),
    EXECUTION("execution", "执行", "0", "0", 12),
    CLOSE_CASE("caseClose", "结案", "1", "0", 13),
    ABOLISH_CASE("wasteCase", "废案", "1", "0", 0),
    FLAW("flaw", "瑕疵", "0", "0", 4),
    WITHDRAWAL("withdrawal", "退案", "0", "0", 3),
    RECONCILIATION("reconciliation", "和解", "0", "0", 0),
    MEDIATION("mediation", "调解", "0", "0", -1);


    public String getLabel() {
        return label;
    }

    private final String label;

    private final String value;

    private final String state;

    private final String merge;

    private final int sorted;

    public String getState() {
        return this.state;
    }

    public int getSorted() {
        return this.sorted;
    }

    public String getValue() {
        return this.value;
    }

    public String getMerge() {
        return this.merge;
    }

    AgreementCaseSateMenu(String label, String value, String state, String merge, int sorted) {
        this.label = label;
        this.value = value;
        this.state = state;
        this.merge = merge;
        this.sorted = sorted;
    }

    public static AgreementCaseSateMenu getAddLabel(String label) {
        AgreementCaseSateMenu currentEnum = getByLabel(label);
        for (AgreementCaseSateMenu menu : AgreementCaseSateMenu.values()) {
            if (currentEnum != null && menu.sorted == currentEnum.getSorted() + 1) {
                return menu;
            }
        }
        return null;
    }

    public static AgreementCaseSateMenu getByLabel(String label) {
        for (AgreementCaseSateMenu menu : AgreementCaseSateMenu.values()) {
            if (menu.label.equals(label)) {
                return menu;
            }
        }
        return null;
    }
}

